package com.at.abc.r418;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class b {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        String s = br.readLine().trim();
        double ans = 0.0;
        for (int l = 0; l < s.length(); l++) {
            for (int r = l + 1; r < s.length(); r++) {
                if (r - l + 1 < 3) {
                    continue;
                }
                ans = Math.max(ans, compute(s.substring(l, r + 1)));
            }
        }
        out.printf("%.18f", ans);
        out.flush();
        out.close();
        br.close();
    }

    public static double compute(String s) {
        int count = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == 't') {
                count++;
            }
        }
        return (double) (count - 2) / (s.length() - 2);
    }
}
